import request from '@/utils/request'

export default {
    /**
     * 生成订单
     * @param {课程id} courseId 
     * @returns 
     */
    createOrder(courseId) {
        return request({
            url: `/orderservice/order/createOrder/${courseId}`,
            method: 'post'
        })
    },
    /**
     * 获取订单信息
     * @param {订单号} orderNo 
     * @returns 
     */
    getOrder(orderNo) {
        return request({
            url: `/orderservice/order/getOrder/${orderNo}`,
            method: 'get'
        })
    },
    /**
     * 生成微信支付二维码
     * @param {订单号} orderNo 
     * @returns 
     */
    createNatvie(orderNo) {
        return request({
            url: `/orderservice/paylog/createNative/${orderNo}`,
            method: 'get'
        })
    },
    /**
     * 查询订单支付状态
     * @param {订单号} orderNo 
     * @returns 
     */
    queryPayStatus(orderNo) {
        return request({
            url: `/orderservice/paylog/queryPayStatus/${orderNo}`,
            method: 'get'
        })
    }
}